package model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the hroute database table.
 * 
 */
@Embeddable
public class HroutePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="r_name")
	private String rName;

	@Column(name="h_email", insertable=false, updatable=false)
	private String hEmail;

	public HroutePK() {
	}
	public String getRName() {
		return this.rName;
	}
	public void setRName(String rName) {
		this.rName = rName;
	}
	public String getHEmail() {
		return this.hEmail;
	}
	public void setHEmail(String hEmail) {
		this.hEmail = hEmail;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof HroutePK)) {
			return false;
		}
		HroutePK castOther = (HroutePK)other;
		return 
			this.rName.equals(castOther.rName)
			&& this.hEmail.equals(castOther.hEmail);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.rName.hashCode();
		hash = hash * prime + this.hEmail.hashCode();
		
		return hash;
	}
}